home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Games / Pentominoes 2.0 / Shell ƒ / generic open.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-29  |  1016 b   |  51 lines  |  [TEXT/MMCC]

  1. #include "generic open.h"
  2. #include "program globals.h"
  3. #include "environment.h"
  4. #include "error.h"
  5. #include "file utilities.h"
  6. #include "save dialog.h"
  7. #include "window layer.h"
  8. #include "pent load-save.h"
  9. #include "pent globals.h"
  10.  
  11. void OpenTheFile(FSSpec *myFSS)
  12. {
  13.     FSSpec            saveFile;
  14.     WindowRef        theWindow;
  15.     short            saveResult;
  16.     Boolean            goon;
  17.     
  18.     switch (GetFileType(myFSS))
  19.     {
  20.         case SAVE_TYPE:
  21.             goon=TRUE;
  22.             theWindow=GetIndWindowRef(kMainWindow);
  23.             if (theWindow!=0L)
  24.             {
  25.                 if (gAskBeforeClosing)
  26.                 {
  27.                     saveFile=GetWindowFS(theWindow);
  28.                     if ((saveResult=DisplaySaveAlert(theWindow, (saveFile.name[0]==0x00) ?
  29.                         "\pthe game in progress" : "\pthe game", saveFile.name,
  30.                         "\popening another"))==kUserCanceled)
  31.                     {
  32.                         goon=FALSE;
  33.                     }
  34.                 }
  35.             }
  36.             
  37.             if (goon)
  38.             {
  39.                 saveFile=*myFSS;
  40.                 HandleError(GetTheFile(&saveFile), FALSE, FALSE);
  41.                 gNeedToOpenWindow=FALSE;    /* not technically needed */
  42.             }
  43.             break;
  44.     }
  45. }
  46.  
  47. void PrintTheFile(FSSpec *myFSS)
  48. {
  49.     #pragma unused(myFSS)
  50. }
  51.